﻿
/*为了缩减创建子类工厂的数量，不必给每一个产品增加工厂类，可以对产品进行分组，每组中的不同产品由同一个工厂类的不同方法来创建*/
using _04抽象工厂;

Console.WriteLine("抽象工厂");
User user = new();
user.Name = "mhg";
user.Id = 1;
//变化点
IFacatory facatory=new SqlserverFacatory(); //MysqlFacatory //SqlliteFacatory
IDatabaseUser databaseUser = facatory.GetDatabaseUser();
databaseUser.InsertUser(user);
databaseUser?.GetUser(user.Id);
Department department = new Department();
department.Name = "研发部";
department.Id = 2;
IDatabaseDepartment databaseDepartment=  facatory.GetDatabaseDepartment();
databaseDepartment.InsertDepartment(department);    
databaseDepartment?.GetDepartment(department.Id);
// 工作五年
